/* 
 * File:   Player.h
 * Author: Pouja
 * 
 * Created on 24 juli 2012, 14:00
 */

#ifndef Player_h
#define Player_h

#include <iostream>
#include <sstream>
#include <map>
#include <assert.h>
#include "Card.h"
#include "Deck.h"
#include "Field.h"
#include "Hand.h"
using namespace std;

class Player {
    string name;
    int level;
    int xp;
    int wins;
    int losses;
    Deck *deck;
    Field *field;
    bool hasTurn;
    Player *opponent;
    map<int,int> mapLevel;
    static const int MAX_LEVEL;
    Hand* hand;
    friend ostream& operator <<(ostream&, const Player&);
    
public:
    Player(string);
    Player(string, int, int, int, int, Deck*);
    
    void setName(string);
    string getName();
    
    void setLevel(int);
    int getLevel();
    
    void setWins(int);
    int getWins();
    
    void setXp(int);
    int getXp();
    
    void setLosses(int);
    int getLosses();
    
    void setDeck(Deck*);
    Deck* getDeck();
    
    void setField(Field*);
    Field* getField();
    
    void setHasTurn(bool);
    bool getHasTurn();
    
    void setOpponent(Player*);
    Player* getOpponent();
    
    void addWin();
    void addLoss();
    void addXp(int xp);
    
    bool firstToGo();
    
    void placeMonsterCard(MonsterCard*,bool,bool);
    void placeSpellCard(SpellTrapCard*,bool);
    void placeTrapCard(SpellTrapCard*);
    void summon(MonsterCard*);
    void tributeSummon(MonsterCard*,MonsterCard*);
    void tributeSummon(MonsterCard*,MonsterCard*,MonsterCard*);
    //void xyzSummon(XyzMonsterCard,bool);
    //void synchroSummon(SynchroMonsterCard,TunerMonsterCard,MonsterCard[],bool);
    //void fusionSummon(FusionMonsterCard,bool);
    void set(MonsterCard*);
    void tributeSet(MonsterCard*,MonsterCard*);
    void tributeSet(MonsterCard*,MonsterCard*,MonsterCard*);
    void attack(Card*,Card*);
    void nextPhase();
    //void selectPhase(Phase);
    void surrender();
    
    void setHand(Hand*);
    Hand* getHand();
    
    void placeMonsterCard(MonsterCard*,bool,bool);
    void placeSpellCard(SpellTrapCard*,bool);
    void placeTrapCard(SpellTrapCard*);
    void summon(MonsterCard*);
    void tributeSummon(MonsterCard*,MonsterCard*);
    void tributeSummon(MonsterCard*,MonsterCard*,MonsterCard*);
    //void xyzSummon(XyzMonsterCard,bool);
    //void synchroSummon(SynchroMonsterCard,TunerMonsterCard,MonsterCard[],bool);
    //void fusionSummon(FusionMonsterCard,bool);
    void set(MonsterCard*);
    void tributeSet(MonsterCard*,MonsterCard*);
    void tributeSet(MonsterCard*,MonsterCard*,MonsterCard*);
    void attack(Card,Card);
    void nextPhase();
    //void selectPhase(Phase);
    void surrender();
    
    bool operator ==(const Player&);
    bool operator !=(const Player&);
    
    string toString();
    
    ~Player();
};

#endif
